package com.wandian.controller
{
	import com.wandian.core.BitmapManager;
	import com.wandian.data.GameData;
	import com.wandian.view.mediator.LoginMediator;

	import flash.display.MovieClip;

	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;

	/**
	 * 登录命令
	 * @author long
	 * @Create  2012-10-3 上午11:45:15
	 * @QQ 108232706
	 * @version 1.0
	 */
	public class LoginCommand extends SimpleCommand
	{
		private var mcLogin:MovieClip;

		public function LoginCommand()
		{
			super();
		}

		public override function execute(notification:INotification):void
		{
//			var body:*=notification.getBody();
			switch (notification.getName())
			{
				case CLZNoticeName.LOGINCOMMAND_ENTER_LOGIN:
				{
					if (!this.facade.hasMediator(LoginMediator.NAME))
					{
						if (!this.mcLogin)
						{
							this.mcLogin=GameData.getMovieClip("UILogin");
						}
						if (!Texas.I._mcTableView.contains(this.mcLogin))
						{
							Texas.I._mcTableView.addChild(this.mcLogin);
							Texas.I._mcTableView.centerXY(this.mcLogin); //居中显示
						}
						this.facade.registerMediator(new LoginMediator(this.mcLogin));
					}
					break;
				}

				default:
				{
					break;
				}
			}

		}
	}
}
